package com.singleton;

/**
 * 线程安全的，但把getInstance()方法设为同步会导致性能下降
 * 
 * @author dell
 * 
 */
public class Singleton {
	private static Singleton uniqueInstance;

	// other useful instance variables here

	private Singleton() {
	}

	public static synchronized Singleton getInstance() {
		if (uniqueInstance == null) {
			uniqueInstance = new Singleton();
		}
		return uniqueInstance;
	}

	// other useful methods here
}
